ADD_SUBDIRECTORY(icons)
FIND_PACKAGE( libpar2 REQUIRED )
FIND_PACKAGE( libsigc REQUIRED )
FIND_PACKAGE( Qt4 )

INCLUDE(${QT_USE_FILE})

INCLUDE_DIRECTORIES( ${KDE4_INCLUDE}
                     ${CMAKE_CURRENT_BINARY_DIR}
                     ${CMAKE_CURRENT_SOURCE_DIR}
                     ${LIBSIGC_INCLUDE_DIRS}
                     ${LIBPAR2_INCLUDE_DIRS} )

ADD_DEFINITIONS(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})

LINK_DIRECTORIES( ${KDE4_LIB_DIR} )

SET( KPAR2_UI kpar.ui general.ui)
SET( KPAR2_SRCS main.cpp kpar.cpp kparengine.cpp kparthread.cpp)

KDE4_ADD_KCFG_FILES( KPAR2_SRCS config.kcfgc )
KDE4_ADD_UI_FILES( KPAR2_SRCS ${KPAR2_UI} )
KDE4_ADD_EXECUTABLE( kpar2 ${KPAR2_SRCS} )

target_link_libraries(kpar2 ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS}  ${LIBSIGC_LIBRARY} ${LIBPAR2_LIBRARY} ) 

install(TARGETS kpar2 ${INSTALL_TARGETS_DEFAULT_ARGS} ) 
INSTALL( FILES kpar2.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications/kde )
INSTALL( FILES x-par2.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/mimelnk/application )
